<template>
  <div class="container"  :style= "{width:$store.state.isMobile ? '100%' : '400px'}">
    <div class="text">
      <p>欢迎您使用直播服务</p>
      <div class="body">
        <span>本服务由{{corporateNname}}提供技术支持，在此过程中我们可能会收集和使用您的相关信息。在您开始使用前，请您务必仔细阅读我们的<a @click="seeYinsi">《隐私政策》</a>，如您点击“同意”开始使用直播服务，我们将按照法律法规要求，采取各种合理必要的措施保障您的个人信息安全。</span>
      </div>
      <div class="btn">
        <button class="left" @click="disagree">不同意</button>
        <button class="right" @click="agree">同意</button>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data(){
      return{
          corporateNname:'中信建投证券股份有限公司'
      }
    },
    created(){
      if(this.$channel=='zxjtqh'){
          this.corporateNname = '中信建投期货有限公司'    
      }         
    },
    methods: {
      disagree() {
        // 不同意返回上一级
        if(fun.getPlatform() == 'wx'){
          this.$router.go(-1);
          return false;
        }
        if (window.terminal.android) {        // h5建投关闭web网页的方法
          KDS_Native.closeCurrentWindow();
        } else {
          window.webkit.messageHandlers.closeCurrentWindow.postMessage("")
        }
      },
      agree() {
        // 把控制隐政策弹窗是否弹起存储在后端
        this.$http.post('/h5live/user/trace/privacy/save').then(res => {
          if (res.data.code == '000000') {
            // 同意隐私政策是更新缓存值并且 更新xuex
            this.$store.state.privacy = false;
            this.$store.state.fn_privacy = false;
          }else{
            this.$store.state.privacy = true;
            this.$store.state.fn_privacy = true;
          }
        }, err => console.log(err));
      },
      seeYinsi(){
        // this.$store.state.fn_privacy = false;
        this.$parent.isPrivacy = true;
      }
    },
  }
</script>

<style scoped="scoped" lang="less">
  .container{
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    z-index: 1001;
  }
  .text{
    width: 600px;
    height: 655px;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 41px 40px 52px 41px;
    p{
      font-size: 36px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: #333333;
      line-height: 50px;
      text-align: center;
    }
    .body{
      margin-top: 44px;
      span{
        font-size: 28px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #666666;
        line-height: 48px;
        a{
          color: #1777FF !important;
          text-decoration:underline;
        }
      }
    }
    .btn{
      margin-top: 52px;
      display: flex;
      justify-content: space-between;
      button{
        border: none;
        width: 220px;
        height: 80px;
        border-radius: 40px;
        font-weight: 400;
        line-height: 34px;
        font-size: 28px;
        font-family: PingFangSC-Regular, PingFang SC;
      }
      .left{
        background: #EAF1FF;
        color: #307CFF;
      }
      .right{
        background: #307CFF;
        color: #FFFFFF;
      }
    }
  }
</style>
